#include <bpf_common.h>
#include <libgen.h>
#include <stdio.h>

int main(int argc, char* argv[]) {
	char* progname = basename(argv[0]);

	bpf_common_init();
	bpf_module* module = find_module(progname);

	if (module == NULL) {
		fprintf(stderr, "Module %s not found\n", progname);
		return -1;
	}
	if (module->open(argc - 1, argv + 1)) {
		return -1;
	}
	module->run();
	module->release();

	return 0;
}
